import axios from "axios";

export const api = {
    host: 'http://10.4.8.89:8089',
    // host: 'https://zeus.jztweb.com',
    // QuerySql: '/zsSysService/api/CommonQuery/Query',
    // InsertSql: '/zsSysService/api/SysFunctionInvoke/InsertSql',
    // InsertSqlList: '/zsSysService/api/SysFunctionInvoke/InsertSqlList',
    // ExecTemplateSql: '/zsSysService/api/SysFunctionInvoke/execTemplateSql',
    // GetI9Staff: '/zsSysService/api/Login/GetLoginUser',
}


export const baseAxios = axios.create({
    baseURL: api.host, //生产环境，可以按环境配 if(process.env.NODE_ENV === 'development')
    timeout: 10000,
    headers: {'Content-Type': 'application/json;charset=UTF-8'},
    // withCredentials: true,
    // responseType: 'json',
    contentType: 'application/json;charset=UTF-8',
})

baseAxios.interceptors.request.use(
    (config)=>{
        config.data['Mc'] = 402
        return config;
    }
)

baseAxios.interceptors.response.use(
    (response)=>{
        return response.data;
    },error=>{
        return Promise.reject(error)
    }
)